<template>
  <div class="printHeader">
    <div class="title">
      <div class="title-l">{{ titles }}</div>
      <div class="title-r">门诊</div>
    </div>
    <div class="baseInfo">
      <div class="baseInfo-t">
        <div class="baseInfo-t-l">病历号：{{ patientData.ID }}</div>
        <div class="baseInfo-t-r">
          就诊日期：{{
            patientData.created_at | dateFormat("yyyy-mm-dd HH:MM:SS")
          }}
        </div>
        <div class="baseInfo-t-r">
          就诊类型：{{ patientData.medical_repeat == 1 ? "初诊" : "复诊" }}
        </div>
      </div>
      <div class="baseInfo-b">
        <div class="baseInfo-b-item">
          <span class="item-title">姓名：</span>
          <p>{{ patientData.real_name }}</p>
        </div>
        <div class="baseInfo-b-item">
          <span class="item-title">性别：</span>
          <p v-if="patientData.gender">
            {{ patientData.gender == "0" ? "男" : "女" }}
          </p>
        </div>
        <div class="baseInfo-b-item">
          <span class="item-title">年龄：</span>
          <p v-if="patientData.age"><span v-if="patientData.age[0]>0">{{ patientData.age[0] }}岁</span><span v-if="patientData.age[1]>0">{{ patientData.age[1] }}月</span><span v-if="patientData.age[2]>0">{{ patientData.age[2] }}天</span></p>
        </div>
        <div class="baseInfo-b-item">
          <span class="item-title">科室：</span>
          <p>{{ patientData.department_name }}</p>
        </div>
      </div>
    </div>
    <div class="result">诊断：{{ patientData.result }}</div>
    <div class="advice">医嘱：{{ patientData.advice||"无" }}</div>
    <div class="type" v-if="types == 1"><h1>RP</h1></div>
    <!-- <div class="type check-type" v-else-if="types==2">
      <p><span>费别：</span><span>检查治疗项</span></p>
    </div> -->
  </div>
</template>

<script>
export default {
  props: {
    titles: {
      type: String,
      default: "处方",
    },
    types: {
      type: Number,
      default: 1,
    },
    patientData: {
      type: Object,
      default: () => {},
    },
  },
  created(){
    console.log(this.patientData)
  }
};
</script>

<style lang="scss" scoped>
@import "@/assets/scss/print/prescriptionHeader.scss";
</style>